package com.ming.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *@Author:何元才
 *@Desc:
 *@data:2021-04-15 22:53
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "book")
public class Book implements Serializable {
    /**
     * 图书id
     */
    @TableId(value = "book_id", type = IdType.AUTO)
    private Integer bookId;

    /**
     * 图书类别
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 图书名称
     */
    @TableField(value = "book_name")
    private String bookName;

    /**
     * 作者
     */
    @TableField(value = "author")
    private String author;

    /**
     * 图书状态 0.未入库 1.未借出 2.已借出 3.已删除
     */
    @TableField(value = "is_rent")
    private Integer isRent;

    /**
     * 入库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "book_time")
    private Date bookTime;

    /**
     * 贡献者id
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 版本号(乐观锁)
     */
    @Version
    @TableField(value = "version")
    private Integer version;

    /**
     * 描述
     */
    @TableField(value = "descp")
    private String descp;

    /**
     * 逻辑删除 0 有效    1 无效
     */
    @TableField(value = "deleted")
    private Integer deleted;
}